home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Document Effects / drop-down-document.izs < prev    next >
Text File  |  2005-08-31  |  4KB  |  122 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Drop-down Document Viewer 
  4. <!/TITLE>
  5.  
  6. <!BROWSER>FF1+ IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION>Use this versatile DHTML script to allow your visitors to select/ view external documents from your site. Specify whether the selected page is loaded in an inline frame or new window.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>document effects<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Simply add the following to the BODY section of your page -->
  16. <form name="jumpy">
  17. <select name="example" size="1" onChange="gone()">
  18. <!-- CHANGE THE BELOW URLS TO YOUR OWN-->
  19. <option value="http://www.yahoo.com" selected>Yahoo.com</option>
  20. <option value="http://www.google.com">Google</option>
  21. <option value="http://www.lycos.com">Lycos</option>
  22. <option value="http://www.AltaVista.com">AltaVista</option>
  23. </select>
  24.  
  25. <input type="button" name="test" value="Go!" onClick="gone()">
  26. </form>
  27.  
  28. <script language="javascript">
  29. <!--
  30.  
  31. //Drop-down Document Viewer- ⌐ Dynamic Drive (www.dynamicdrive.com)
  32. //For full source code, 100's more DHTML scripts, and TOS,
  33. //visit http://www.dynamicdrive.com
  34.  
  35. //Specify display mode (0 or 1)
  36. //0 causes document to be displayed in an inline frame, while 1 in a new browser window
  37. var displaymode=1
  38. //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
  39. var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'
  40.  
  41. /////NO NEED TO EDIT BELOW HERE////////////
  42.  
  43. if (displaymode==0)
  44. document.write(iframecode)
  45.  
  46. function gone(){
  47. var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
  48. if (document.getElementById&&displaymode==0)
  49. document.getElementById("external").src=selectedurl
  50. else if (document.all&&displaymode==0)
  51. document.all.external.src=selectedurl
  52. else{
  53. if (!window.win2||win2.closed)
  54. win2=window.open(selectedurl)
  55. //else if win2 already exists
  56. else{
  57. win2.location=selectedurl
  58. win2.focus()
  59. }
  60. }
  61. }
  62. //-->
  63. </script>
  64. <!-- END OF SCRIPT -->
  65. <!/SCRIPT>
  66.  
  67. <!PREVIEW>
  68. <!-- START OF SCRIPT -->
  69. <!-- Step 1: Simply add the following to the BODY section of your page -->
  70. <form name="jumpy">
  71. <select name="example" size="1" onChange="gone()">
  72. <!-- CHANGE THE BELOW URLS TO YOUR OWN-->
  73. <option value="http://www.yahoo.com" selected>Yahoo.com</option>
  74. <option value="http://www.google.com">Google</option>
  75. <option value="http://www.lycos.com">Lycos</option>
  76. <option value="http://www.AltaVista.com">AltaVista</option>
  77. </select>
  78.  
  79. <input type="button" name="test" value="Go!" onClick="gone()">
  80. </form>
  81.  
  82. <script language="javascript">
  83. <!--
  84.  
  85. //Drop-down Document Viewer- ⌐ Dynamic Drive (www.dynamicdrive.com)
  86. //For full source code, 100's more DHTML scripts, and TOS,
  87. //visit http://www.dynamicdrive.com
  88.  
  89. //Specify display mode (0 or 1)
  90. //0 causes document to be displayed in an inline frame, while 1 in a new browser window
  91. var displaymode=1
  92. //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
  93. var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'
  94.  
  95. /////NO NEED TO EDIT BELOW HERE////////////
  96.  
  97. if (displaymode==0)
  98. document.write(iframecode)
  99.  
  100. function gone(){
  101. var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
  102. if (document.getElementById&&displaymode==0)
  103. document.getElementById("external").src=selectedurl
  104. else if (document.all&&displaymode==0)
  105. document.all.external.src=selectedurl
  106. else{
  107. if (!window.win2||win2.closed)
  108. win2=window.open(selectedurl)
  109. //else if win2 already exists
  110. else{
  111. win2.location=selectedurl
  112. win2.focus()
  113. }
  114. }
  115. }
  116. //-->
  117. </script>
  118.  
  119. <!-- END OF SCRIPT -->
  120. <!/PREVIEW>
  121.  
  122. <!RELATED>NONE<!/RELATED>